package com.jhgk.gateway.controller;

import com.jhgk.gateway.feign.FacilityClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author zero
 */
@RestController
@RequestMapping
@Slf4j
@RefreshScope
public class TestController {
    @Resource
    private FacilityClient facilityClient;

    @Value("${zero.test}")
    private String string;

    @GetMapping("/zero/zero")
    public String zero() throws InterruptedException {
        return string;
    }

    @GetMapping("/zero")
    public String zero2() {
        return facilityClient.hello();
    }
}
